<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>发布作品</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1,user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" type="text/css"
	href="../static/bootstrap3/css/bootstrap.css">
<link rel="stylesheet" type="text/css"
	href="../static/bootstrap3/font-awesome-4.7.0/css/font-awesome.css" />
	<style type="text/css">
		body {
			padding-top: 20px;
			color: #d73e22;
		}
		.navbar{
			background-color: #d5d5d5;
			border: none;
		}
		h3{
			color: #e73f0a;
			position: absolute;
			left: 43%;
			top: -7px;
		}

		#back{
			color: #e73f0a;
			position: relative;
			left: -10px;
		}
		.a{
			position: relative;
			color: #ff00d5;
			top: 20px;
			font-size: 30px;
		}

	</style>
</head>
<body>
<header>
	<div class="container">
		<nav class="navbar navbar-default">
			<h3>修改商品</h3>
			<ul class="nav navbar-nav navbar-right">
				<li><a id="back" href="http://localhost:8080/sIndex">返回首页</a></li>
			</ul>
		</nav>
	</div>
</header>

<div class="container">
	<div class="row">
		<!--左侧主要内容-->
		<div class="col-md-offset-2 col-md-8">
			<div class="bs-docs-section">
				<div class="hide" id="id" th:text="${changeGoods.id}"></div>
				<div class="form-group">
					<label for="name">商品名称</label>
					<input type="text" class="form-control" id="name" name="name" th:value="${changeGoods.name}">
				</div>
				<div class="form-group">
					<label price="aabstract">商品价格</label>
					<input type="text" class="form-control" id="price" name="price" th:value="${changeGoods.price}">
				</div>
				<div id="res" class="a"></div>
				<div class="text-center">
					<button class="btn btn-danger btn-lg" id="btn">确定修改</button>
				</div>
			</div>
		</div>
		<!--左侧内容结束-->
	</div>
</div>

</body>
<script type="text/javascript" src="../static/bootstrap3/jquery.min.js"></script>
<script type="text/javascript" src="../static/bootstrap3/js/bootstrap.js"></script>
<script type="text/javascript" src="../static/bootstrap3/js/holder.js"></script>
<script type="text/javascript" src="../static/bootstrap3/js/html5shiv.min.js"></script>
<script type="text/javascript" src="../static/bootstrap3/js/css3-mediaqueries.js"></script>
<script type="text/javascript" src="../static/bootstrap3/js/respond.min.js"></script>
<script type="text/javascript" src="../static/js/vue.js"></script>
<script type="text/javascript">
	$("#btn").click(function () {
		let id = parseInt($("#id").text());
		$.ajax({
			type: "POST",
			url: "changeGoodsMessage",
			data: {"id":id,"name":$("#name").val(),"price":$("#price").val()},
			success: function (data) {
				alert(data);
			}
		})
	})
</script>
</html>